import { Module, Global } from '@nestjs/common';
import { CommonService } from './common.service';
import { ConfigModule } from '@nestjs/config'
import {JwtModule, JwtService} from '@nestjs/jwt'
import { DbModule } from '@libs/db';
import { MulterModule } from '@nestjs/platform-express';
import { JwtStrategy } from 'src/jwt.strategy';
@Global()
@Module({
  imports:[
    ConfigModule.forRoot({
      isGlobal: true,
     }),
     JwtModule.registerAsync({
      useFactory(){
          return {
            secret:process.env.secret,
          
          }
      }
     }),
     
     DbModule
  ],
  providers: [CommonService,JwtStrategy],
  exports: [CommonService,JwtModule],
})
export class CommonModule {}
